package br.edu.granbery.indianostore.model;

import java.util.ArrayList;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name = "carrinho", schema = "indianostoredb")
public class Carrinho {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private int id;

    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "idCliente")
    private Cliente cliente;
    
    //@OneToMany(mappedBy = "carrinho", fetch = FetchType.LAZY)
    //private ArrayList<ItemCarrinho> itemCarrinho = new ArrayList<ItemCarrinho>();

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the cliente
     */
    public Cliente getCliente() {
        return cliente;
    }

    /**
     * @param cliente the cliente to set
     */
    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    /**
     * @return the itemCarrinho
     */
   // public ArrayList<ItemCarrinho> getItemCarrinho() {
   //     return itemCarrinho;
    //}

    /**
     * @param itemCarrinho the itemCarrinho to set
     */
    //public void setItemCarrinho(ItemCarrinho itemCarrinho) {
    //    this.itemCarrinho.add(itemCarrinho);
    //}

}
